﻿{% extends "base.html" %}

{% block title %}Просмотр профиля{% endblock %}

{% block header %}{{ userprofile.first_name }} {{ userprofile.last_name }}{% endblock %}

{% block content %}

<ul>
	{% if friendships %}
		{% for f in friendships %}
			<li class="friendship">
				<a href="{{ 'userprofile.views.view_profile'|url(id=f.id|int) }}">{{ f.first_name }} {{ f.last_name}}</a>
				<a href="{{ 'userprofile.views.allow_friendship'|url(id=f.id|int) }}">+</a>
				<a href="{{ 'userprofile.views.deny_friendship'|url(id=f.id|int) }}">-</a>
			</li>
		{% endfor %}
	{% endif %}
	{% if profiles.object_list %}
		{% for f in profiles.object_list %}
			<li class="list_profile">
				<a href="{{ 'userprofile.views.view_profile'|url(id=f.id|int) }}">{{ f.first_name }} {{ f.last_name}}</a>
			</li>
		{% endfor %}
	{% endif %}
</ul>
<div class="pagination">
    <span class="step-links">
        {% if profiles.has_previous() %}
            <a class="p_link" href="{{ path }}?page={{ profiles.previous_page_number }}">предыдущая</a>
        {% endif %}
        
        {% for num in profiles.paginator.page_range %}
			{% if num == profiles.number %}
		        <span class="item current">
		            {{ num }}
		        </span>
	        {% else %}
		        <span class="item">
		            <a href="{{ path }}?page={{ num }}">{{ num }}</a>
		        </span>
	        {% endif %}
		{% endfor %}
		
        {% if profiles.has_next() %}
            <a class="p_link" href="{{ path }}?page={{ customers.next_page_number }}">следующая</a>
        {% endif %}
    </span>
</div>
{% endblock %}
